#include <bits/stdc++.h>
using namespace std;

const int N = 100010;
int a[N];
int n, m;

int check(int x)
{
	int cnt = 0;
	for (int i = 0; i < n; i++) {
		cnt += a[i] / x;
		if (cnt >= m) return true;
	}
	return false;
}

int main() 
{
	// N块原木，切割成K块小木板
	int N, K;
	cin >> N >> K;

	// N块原木的长度
	int a[N];
	for (int i = 0; i < N; i++)
		cin >> a[i];

	int l = 0, r = 0;
	for (int i = 0; i < n; i++) r += a[i];
	while (l < r)
	{
		int mid = l + r + 1 >> 1;
		if (check(mid)) l = mid;
		else r = mid - 1;
	}
	cout << l << endl;
	return 0;
}
